//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.ruoyi.system.controller;

import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.system.api.domain.XinjiangSmsSend95598;
import com.ruoyi.system.service.IXinjiangSmsSend95598Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping({"/xjAnnounce"})
public class XinjiangSmsSend95598Controller extends BaseController {
    @Autowired
    private IXinjiangSmsSend95598Service xinjiangSmsSend95598Service;

    public XinjiangSmsSend95598Controller() {
    }

    @GetMapping({"/list"})
    public List<XinjiangSmsSend95598> list() {
        return this.xinjiangSmsSend95598Service.selectXinjiangSmsSend95598List();
    }

    @RequiresPermissions({"system:xjAnnounce:query"})
    @GetMapping({"/{cmsid}"})
    public AjaxResult getInfo(@PathVariable("cmsid") Long cmsid) {
        return AjaxResult.success(this.xinjiangSmsSend95598Service.selectXinjiangSmsSend95598ByCmsid(cmsid));
    }

    @RequiresPermissions({"system:xjAnnounce:add"})
    @Log(
            title = "停电影响用户发送短信",
            businessType = BusinessType.INSERT
    )
    @PostMapping
    public AjaxResult add(@RequestBody XinjiangSmsSend95598 xinjiangSmsSend95598) {
        return this.toAjax(this.xinjiangSmsSend95598Service.insertXinjiangSmsSend95598(xinjiangSmsSend95598));
    }

    @RequiresPermissions({"system:xjAnnounce:edit"})
    @Log(
            title = "停电影响用户发送短信",
            businessType = BusinessType.UPDATE
    )
    @PutMapping
    public AjaxResult edit(@RequestBody XinjiangSmsSend95598 xinjiangSmsSend95598) {
        return this.toAjax(this.xinjiangSmsSend95598Service.updateXinjiangSmsSend95598(xinjiangSmsSend95598));
    }

    @RequiresPermissions({"system:xjAnnounce:remove"})
    @Log(
            title = "停电影响用户发送短信",
            businessType = BusinessType.DELETE
    )
    @DeleteMapping({"/{cmsids}"})
    public AjaxResult remove(@PathVariable Long[] cmsids) {
        return this.toAjax(this.xinjiangSmsSend95598Service.deleteXinjiangSmsSend95598ByCmsids(cmsids));
    }
}
